package com.suse.lhw.domin;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ProjectName: health_manage_system
 * @Package: com.suse.lhw.domin
 * @ClassName: PHealthrecord
 * @Description: java类作用描述
 * @Author: 李鸿炜
 * @CreateDate: 2020/5/21 21:40
 * @UpdateUser: 更新者
 * @UpdateDate: 2020/5/21 21:40
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
@Data
public class PHealthrecord {
    private Integer id;

    private String userid;

    /**
     * 开始日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date startDate;

    /**
     * 当前体重
     */
    private Double hrWeight;

    /**
     * 目标达成时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date deadline;

    /**
     * 目标达成体重
     */
    private Double targetWight;

    /**
     * 初始体重
     */
    private Double initialWeight;

    public Integer getRegular() {
        return regular;
    }

    public void setRegular(Integer regular) {
        this.regular = regular;
    }

    //今天应该减少的卡路里
    private Integer regular;

    /**
     * 今天还能吃的千卡热量
     */
    private Integer eatCalories;

    /**
     * 今天已经吃的卡路里
     */
    private Integer ateCalories;

    /**
     * 每天固定消耗的卡路里
     */
    private Integer dailyCosumedCalories;

    /**
     * 今天运动消耗的卡路里
     */
    private Integer movementCalories;

    /**
     * 状态，1是需要更新，2是无需更新
     */
    private Integer status;

    /**
     * 今天的日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date today;

    public PHealthrecord(String userid, Date startDate, Double hrWeight, Date deadline, Double targetWight, Double initialWeight, Integer status, Date today) {
        this.userid = userid;
        this.startDate = startDate;
        this.hrWeight = hrWeight;
        this.deadline = deadline;
        this.targetWight = targetWight;
        this.initialWeight = initialWeight;
        this.status = status;
        this.today = today;
    }
}